package com.miracle.设计模式.创建型模式.工厂方法模式.案例2_重载;

import java.util.List;

// 数据库日志记录器工厂类，具体工厂
public class DatabaseLoggerFactory implements LoggerFactory {
    @Override
    public Logger getLogger() {
        System.out.println("==>创建DatabaseLogger begin");
        Logger logger = new DatabaseLogger();
        System.out.println("==>创建DatabaseLogger end");
        return logger;
    }

    @Override
    public Logger getLogger(String args) {
        System.out.println("==>创建DatabaseLogger begin");
        System.out.println("==>传入参数String："+args);
        Logger logger = new DatabaseLogger();
        System.out.println("==>创建DatabaseLogger end");
        return logger;
    }

    @Override
    public Logger getLogger(List list) {
        System.out.println("==>创建DatabaseLogger begin");
        System.out.println("==>传入参数List："+list.toString());
        Logger logger = new DatabaseLogger();
        System.out.println("==>创建DatabaseLogger end");
        return logger;
    }
}
